package com.pompom.matchcrawler;

import java.util.Map;

import nl.ansuz.android.steam.dota.request.match.GetMatchDetails;
import nl.ansuz.android.steam.dota.request.match.GetMatchHistory;
import nl.ansuz.android.steam.dota.response.match.GetMatchDetailsResponse;
import nl.ansuz.android.steam.dota.response.match.GetMatchHistoryResponse;
import nl.ansuz.android.steam.request.ISteamRequest;

public class MatchHistoryFetcher extends AbstractFecher<GetMatchHistoryResponse>{
	private Long lstartingMatch=(long)-1;
	private Long dateMin=-1l,dateMax=-1l;
	private Integer lskillLevel=-1;
	private Long accountId=-1l;

 
	public MatchHistoryFetcher(Long dateMax, Long accountId) {
		super();
		this.dateMax = dateMax;
		this.accountId = accountId;
	}

	public MatchHistoryFetcher( Long accountId) {
		super();
		 
		this.accountId = accountId;
	}

	
	public MatchHistoryFetcher(Long lstartingMatch, Integer lskillLevel,Long dateMin,Long dateMax) {
		this.lstartingMatch = lstartingMatch;
		this.lskillLevel = lskillLevel;
		this.dateMax =dateMax;
		this.dateMin = dateMin;
	}

	@Override
	protected ISteamRequest getSteamRequest() {
		return new GetMatchDetails();
	}

	@Override
	protected void setParams(Map<String, String> params) {
		if (lstartingMatch!=-1)
			params.put("start_at_match_id", lstartingMatch.toString());
		if (lskillLevel!=-1)
			params.put("skill ", lskillLevel.toString());
		if(dateMax!=-1)
			params.put("date_max", dateMax.toString());
		if (dateMin!=-1)
			params.put("date_min", dateMin.toString());
		if (accountId!=-1)
			params.put("account_id", accountId.toString());
	}

	@Override
	protected Class<GetMatchHistoryResponse> getResponseType() {
		return GetMatchHistoryResponse.class;
	}
}
